package com.service.device;

import com.dao.secondary.device.DevicePcbDayInfoMapper;
import com.github.pagehelper.PageHelper;
import com.model.domain.device.GetDevicePcbDayInfoDO;
import com.model.pojo.device.DevicePcbDayInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @Author: zql
 * @Description: PCB每日轨迹统计服务
 * @Data: 2023-05-22
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class DevicePcbDayInfoService {

    private  final DevicePcbDayInfoMapper devicePcbDayInfoMapper;

    /**
     * 查询所有
     * @author tm
     * @date 2023-05-22 0:34
     * @param getDevicePcbDayInfoDO
     * @return List<DevicePcbDayInfo>
     */
    public List<DevicePcbDayInfo> getAll(GetDevicePcbDayInfoDO getDevicePcbDayInfoDO){
        PageHelper.clearPage();
        PageHelper.orderBy(getDevicePcbDayInfoDO.getSortRow() + getDevicePcbDayInfoDO.getSortOrder());
        return devicePcbDayInfoMapper.selectList(getDevicePcbDayInfoDO);
    }

    public void saveList(List<DevicePcbDayInfo> dayList){
         devicePcbDayInfoMapper.insertListSelective( dayList);
    }
}
